


.section .text, "ax"
.global asm_start
asm_start:
  /* clear Interrupt Registers */
  csrw sie, 0
  csrw sip, 0
  /* set Trap Vector Base Address Register */
  # la t0, trap_entry
  # csrw stvec, t0

  li x1, 0
  li x2, 0
  li x3, 0
  li x4, 0
  li x5, 0
  li x6, 0
  li x7, 0
  li x8, 0
  li x9, 0
  li x10,0
  li x11,0
  li x12,0
  li x13,0
  li x14,0
  li x15,0
  li x16,0
  li x17,0
  li x18,0
  li x19,0
  li x20,0
  li x21,0
  li x22,0
  li x23,0
  li x24,0
  li x25,0
  li x26,0
  li x27,0
  li x28,0
  li x29,0
  li x30,0
  li x31,0

  /* set to disable FPU */
  # li t0, SSTATUS_FS + SSTATUS_VS
  # csrc sstatus, t0
  # li t0, SSTATUS_SUM
  # csrs sstatus, t0


  /* removed SMP support here */
  la   sp, gSystemStack
  li   t0, 4096
  add  sp, sp, t0


  /**
    * sscratch is always zero on kernel mode
    */
  csrw sscratch, zero
  # call init_bss
  # call sbi_init
  j startup_astrial

.end 
  